<script type="text/javascript">
$(document).ready(function(){
	countUnreadAlerts();
});

function countUnreadAlerts(){
	$.ajax({
		type:'POST',
		async:false,
		url:'/merchant/my-account/count-unread-alerts',
		dataType:'json',
		data:{'test':'test'},
		success:function(json){
			var html = '';
			if(json.ask==1){
				var val = json.unread;
				if(val.notice){
					html += '<div style="cursor:pointer;"><a onclick=\'toLink("/merchant/alert/get-alerts/level/0")\'>';
					html += 'You have <span style="color:red">'+val.notice+'</span> notices to read!</a></div>';					
				}
				if(val.warning){
					html += '<div style="cursor:pointer;"><a onclick=\'toLink("/merchant/alert/get-alerts/level/1")\'>';
					html += 'You have <span style="color:red">'+val.warning+'</span> warnings to read!</a></div>';					
				}
				if(val.important){
					html += '<div style="cursor:pointer;"><a onclick=\'toLink("/merchant/alert/get-alerts/level/2")\'>';
					html += 'You have <span style="color:red">'+val.important+'</span> important messages to read!</a></div>';					
				}
				
			}else {
				html += '<span class="user-alert-txt">You have no alerts</span>';				
			}
			$("#alertBox").html(html);
		}
	});
	
}

</script>

<style type="text/css">
	.boldGreen{color:blue;font-weight:bold}
</style>
<div class="position"><a href='/default/index'>首页</a> &gt; <a href='/merchant/my-account'>商户中心</a>  &gt; 您的帐户 &gt; 帐户信息</div>
<div class="merchant-content">
<div class="user-alert">
            <div class="user-alert-top">帐户</div>
            <div class="user-alert-middle">
				<div class="user-alert-1">

					<span class="user-alert-txt bold" style="display:inline-block;text-align:left;width:45%">可用余额:</span>
					<span class="bold" style="display:inline-block;text-align:right;width:50%"><{if is_object($balance)}><{($balance->cb_value)|string_format:"%.2f"}> <{$balance->currency_code}><{/if}></span>
					</div>
					<div class="dashBoardClass" style="margin-top:10px;">
                        <li style="float:right; margin-right:5px; font-weight:bold;" onclick="toLink('/merchant/my-account/billing')">帐户清单</li></ul>
					</div>

				<div class="clearFloat"></div>



			</div>
            <div class="user-alert-bottom"></div>
</div>
	
</div>